import { ResponseModel, ResponseStructure } from '@/model/responseModel';
import { RequestServiceProxy } from '@/utils/request';
import {
  AreaModel,
  DeviceModel,
  DoorModel,
  ElectmapModel,
  ExceptionrecordsModel,
  HighsecurityModel,
  MonitoringModel,
  PassageModel,
  PeriodModel,
  RecordsModel,
} from './data';

const _request = new RequestServiceProxy();

// 获取门分页列表
export async function getDoorList(
  param?: DoorModel.doorRequest,
): Promise<ResponseStructure<ResponseModel<DoorModel.doorResponse>>> {
  return await _request.post('/access/door/page', param);
}

//门查询
export async function queryDoor(
  param: DoorModel.doorRequest,
): Promise<ResponseStructure<DoorModel.doorResponse>> {
  return await _request.post<ResponseStructure<DoorModel.doorResponse>>(
    '/access/door/query',
    param,
  );
}

//新增门
export async function createDoor(param: DoorModel.doorResponse): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/door/create', param);
}

//修改门
export async function updateDoor(param: DoorModel.doorResponse): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/door/update', param);
}

//删除门
export async function deleteDoor(
  param: DoorModel.deleteDoorModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/door/delete', param);
}

// 获取设备分页列表
export async function getDeviceList(
  param?: DeviceModel.deviceRequest,
): Promise<ResponseStructure<ResponseModel<DeviceModel.deviceResponse>>> {
  return await _request.post('/access/device/page', param);
}

//设备查询
export async function queryDevice(
  param: DeviceModel.deviceRequest,
): Promise<ResponseStructure<DeviceModel.deviceResponse>> {
  return await _request.post<ResponseStructure<DeviceModel.deviceResponse>>(
    '/access/device/query',
    param,
  );
}

//新增设备
export async function createDevice(
  param: DeviceModel.deviceResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/device/create', param);
}

//修改设备
export async function updateDevice(
  param: DeviceModel.deviceResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/device/update', param);
}

//删除设备
export async function deleteDevice(
  param: DeviceModel.deleteDeviceModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/device/delete', param);
}

// 获取通行分页列表
export async function getPassageList(
  param?: PassageModel.passageRequest,
): Promise<ResponseStructure<ResponseModel<PassageModel.passageResponse>>> {
  return await _request.post('/access/passage/page', param);
}

//通行查询
export async function queryPassage(
  param: PassageModel.passageRequest,
): Promise<ResponseStructure<PassageModel.passageResponse>> {
  return await _request.post<ResponseStructure<PassageModel.passageResponse>>(
    '/access/passage/query',
    param,
  );
}

//新增通行
export async function createPassage(
  param: PassageModel.passageResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/passage/create', param);
}

//修改通行
export async function updatePassage(
  param: PassageModel.passageResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/passage/update', param);
}

//删除通行
export async function deletePassage(
  param: PassageModel.deletePassageModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/passage/delete', param);
}

// 获取时段分页列表
export async function getPeriodList(
  param?: PeriodModel.periodRequest,
): Promise<ResponseStructure<ResponseModel<PeriodModel.periodResponse>>> {
  return await _request.post('/access/period/page', param);
}

//时段查询
export async function queryPeriod(
  param: PeriodModel.periodRequest,
): Promise<ResponseStructure<PeriodModel.periodResponse>> {
  return await _request.post<ResponseStructure<PeriodModel.periodResponse>>(
    '/access/period/query',
    param,
  );
}

//新增时段
export async function createPeriod(
  param: PeriodModel.periodResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/period/create', param);
}

//修改时段
export async function updatePeriod(
  param: PeriodModel.periodResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/period/update', param);
}

//删除时段
export async function deletePeriod(
  param: PeriodModel.deletePeriodModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/period/delete', param);
}

// 获取监控分页列表
export async function getMonitoringList(
  param?: MonitoringModel.monitoringRequest,
): Promise<ResponseStructure<ResponseModel<MonitoringModel.monitoringResponse>>> {
  return await _request.post('/access/monitoring/page', param);
}

//监控查询
export async function queryMonitoring(
  param: MonitoringModel.monitoringRequest,
): Promise<ResponseStructure<MonitoringModel.monitoringResponse>> {
  return await _request.post<ResponseStructure<MonitoringModel.monitoringResponse>>(
    '/access/monitoring/query',
    param,
  );
}

//新增监控
export async function createMonitoring(
  param: MonitoringModel.monitoringResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/monitoring/create', param);
}

//修改监控
export async function updateMonitoring(
  param: MonitoringModel.monitoringResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/monitoring/update', param);
}

//删除监控
export async function deleteMonitoring(
  param: MonitoringModel.deleteMonitoringModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/monitoring/delete', param);
}

// 获取门禁分页列表
export async function getAreaList(
  param?: AreaModel.areaRequest,
): Promise<ResponseStructure<ResponseModel<AreaModel.areaResponse>>> {
  return await _request.post('/access/area/page', param);
}

//门禁查询
export async function queryArea(
  param: AreaModel.areaRequest,
): Promise<ResponseStructure<AreaModel.areaResponse>> {
  return await _request.post<ResponseStructure<AreaModel.areaResponse>>(
    '/access/area/query',
    param,
  );
}

//新增门禁
export async function createArea(param: AreaModel.areaResponse): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/area/create', param);
}

//修改门禁
export async function updateArea(param: AreaModel.areaResponse): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/area/update', param);
}

//删除门禁
export async function deleteArea(
  param: AreaModel.deleteAreaModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/area/delete', param);
}

// 获取高级门禁分页列表
export async function getHighsecurityList(
  param?: HighsecurityModel.highsecurityRequest,
): Promise<ResponseStructure<ResponseModel<HighsecurityModel.highsecurityResponse>>> {
  return await _request.post('/access/highsecurity/page', param);
}

//高级门禁查询
export async function queryHighsecurity(
  param: HighsecurityModel.highsecurityRequest,
): Promise<ResponseStructure<HighsecurityModel.highsecurityResponse>> {
  return await _request.post<ResponseStructure<HighsecurityModel.highsecurityResponse>>(
    '/access/highsecurity/query',
    param,
  );
}

//新增高级门禁
export async function createHighsecurity(
  param: HighsecurityModel.highsecurityResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/highsecurity/create', param);
}

//修改高级门禁
export async function updateHighsecurity(
  param: HighsecurityModel.highsecurityResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/highsecurity/update', param);
}

//删除高级门禁
export async function deleteHighsecurity(
  param: HighsecurityModel.deleteHighsecurityModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/highsecurity/delete', param);
}

// 获取进出记录分页列表
export async function getRecordsList(
  param?: RecordsModel.recordsRequest,
): Promise<ResponseStructure<ResponseModel<RecordsModel.recordsResponse>>> {
  return await _request.post('/access/records/page', param);
}

//进出记录查询
export async function queryRecords(
  param: RecordsModel.recordsRequest,
): Promise<ResponseStructure<RecordsModel.recordsResponse>> {
  return await _request.post<ResponseStructure<RecordsModel.recordsResponse>>(
    '/access/records/query',
    param,
  );
}

//新增进出记录
export async function createRecords(
  param: RecordsModel.recordsResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/records/create', param);
}

//修改进出记录
export async function updateRecords(
  param: RecordsModel.recordsResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/records/update', param);
}

//删除进出记录
export async function deleteRecords(
  param: RecordsModel.deleteRecordsModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/records/delete', param);
}

// 获取异常分页列表
export async function getExceptionrecordsList(
  param?: ExceptionrecordsModel.exceptionrecordsRequest,
): Promise<ResponseStructure<ResponseModel<ExceptionrecordsModel.exceptionrecordsResponse>>> {
  return await _request.post('/access/exceptionrecords/page', param);
}

//异常查询
export async function queryExceptionrecords(
  param: ExceptionrecordsModel.exceptionrecordsRequest,
): Promise<ResponseStructure<ExceptionrecordsModel.exceptionrecordsResponse>> {
  return await _request.post<ResponseStructure<ExceptionrecordsModel.exceptionrecordsResponse>>(
    '/access/exceptionrecords/query',
    param,
  );
}

//新增异常
export async function createExceptionrecords(
  param: ExceptionrecordsModel.exceptionrecordsResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/exceptionrecords/create', param);
}

//修改异常
export async function updateExceptionrecords(
  param: ExceptionrecordsModel.exceptionrecordsResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/exceptionrecords/update', param);
}

//删除异常
export async function deleteExceptionrecords(
  param: ExceptionrecordsModel.deleteExceptionrecordsModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/exceptionrecords/delete', param);
}

// 获取电子地图分页列表
export async function getElectmapList(
  param?: ElectmapModel.electmapRequest,
): Promise<ResponseStructure<ResponseModel<ElectmapModel.electmapResponse>>> {
  return await _request.post('/access/electmap/page', param);
}

//电子地图查询
export async function queryElectmap(
  param: ElectmapModel.electmapRequest,
): Promise<ResponseStructure<ElectmapModel.electmapResponse>> {
  return await _request.post<ResponseStructure<ElectmapModel.electmapResponse>>(
    '/access/electmap/query',
    param,
  );
}

//新增电子地图
export async function createElectmap(
  param: ElectmapModel.electmapResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/electmap/create', param);
}

//修改电子地图
export async function updateElectmap(
  param: ElectmapModel.electmapResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/electmap/update', param);
}

//删除电子地图
export async function deleteElectmap(
  param: ElectmapModel.deleteElectmapModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/access/electmap/delete', param);
}
